package com.efast.dmom.mgmt.controller.les;

import java.util.Map;
import com.efast.cafe.framework.bean.ResultBean;
import com.efast.dmom.mgmt.bean.les.LocDlocWhBean;
import com.efast.dmom.mgmt.bean.les.TwInvSkuLoctlBean;
import com.efast.dmom.mgmt.bean.les.TwInvSkuLoctlStatementBean;
import com.efast.dmom.mgmt.service.les.TwInvSkuLoctlService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 
 * @ClassName: TwInvSkuLoctlController
 * @Description: 库存调整
 * @author ChenLiPeng
 * @date 2018年4月17日
 *
 */
@Controller
@RequestMapping(value = "/twInvSkuLoctl")
@Api(description = "物流执行管理-->出库-->库存调整")
public class TwInvSkuLoctlController {

	@Autowired
	private TwInvSkuLoctlService twInvSkuLoctlService;

	@ApiOperation(value = "【库存编辑】", notes = "请求参数：")
	@RequestMapping(value = "/edit", method = RequestMethod.POST)
	public @ResponseBody ResultBean edit(@RequestBody TwInvSkuLoctlBean twInvSkuLoctlBean) {
		ResultBean result = new ResultBean(true, "'");
		twInvSkuLoctlService.updateNonEmptyTwInvSkuLoctlById(twInvSkuLoctlBean);
		return result;
	}

	@ApiOperation(value = "【通过库位查询库区仓库】", notes = "请求参数：{\"tmBasStorageId\":\"XXX\"}")
	@RequestMapping(value = "/queryParentNo", method = RequestMethod.POST)
	public @ResponseBody ResultBean queryParentNo(@RequestBody Map<Object, Object> map) {
		ResultBean result = new ResultBean(true, "'");
		LocDlocWhBean locDlocWhBean = twInvSkuLoctlService.queryParentNo((int) map.get("tmBasStorageId"));
		result.setObject(locDlocWhBean);
		return result;
	}
	
	
	@ApiOperation(value = "库存表报查询接口", notes = "请求参数：")
	@RequestMapping(value = "/queryStatement", method = RequestMethod.POST)
	public @ResponseBody ResultBean queryStatement() {
		ResultBean result = new ResultBean(true, "'");
		TwInvSkuLoctlStatementBean twInvSkuLoctlStatementBean = twInvSkuLoctlService.queryStatement();
		result.setObject(twInvSkuLoctlStatementBean);
		return result;
	}
	
	

}
